package com.share.dao.sysmgr.privilege;

import java.io.Serializable;
import java.util.List;

import org.springframework.stereotype.Component;

import com.share.bean.sysmgr.privilege.PrivilegeResourceItem;
import com.share.commons.base.dao.BaseDaoSupport;


@Component("privilegeResourceItemDao")
public class PrivilegeResourceItemDaoImpl extends BaseDaoSupport<PrivilegeResourceItem> implements PrivilegeResourceItemDao{

	@Override
	public void deleteResourceItemDao(int id) throws RuntimeException {
		
		this.deleteObject(this.queryByIdResourceItemDao(id)) ;
	}

	@Override
	public PrivilegeResourceItem queryByIdResourceItemDao(int id) throws RuntimeException {
		
		return (PrivilegeResourceItem) this.getById(PrivilegeResourceItem.class, id) ;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<PrivilegeResourceItem> queryResourceItemDao(String hql)
			throws RuntimeException {
		
		return (List<PrivilegeResourceItem>) this.find(hql) ;
	}

	@Override
	public Serializable saveResourceItemDao(PrivilegeResourceItem res) throws RuntimeException {
		
		return this.saveObjectRet(res) ;
	}

	@Override
	public void updateResourceItemDao(PrivilegeResourceItem res) throws RuntimeException {
		this.updateObject(res) ;
	}


}
